import React from "react";

export const PageContext = React.createContext({
    pages: [{
        name: "",
        key: ""
    }],
    setPages: (pages:Array<any>) => {},
    now: {
        name: "",
        key: ""
    },
    setNow: (now:any) => {}
});

export const FormContext = React.createContext({
    apiId:"",
    apiName: "",
    folderId: "",
    apiMethod: "GET",
    apiPath: "",
    apiStatus:"",
    description: "",
    requestHeader: [{key:"",value:""}],
    responseHeader: [{key: "", value:""}],
    query: [{key: "", value:""}],
    requestBody: {
        type: "json",
        nodes: [{
            name: "",
            value: "",
            type: "string",
            note: "",
            must: true,
            lv: 1
        },
        {
            name: "",
            value: "",
            type: "string",
            note: "",
            must: true,
            lv: 2
        },
        {
            name: "",
            value: "",
            type: "string",
            note: "",
            must: true,
            lv: 1
        }]
    },
    responseBody: {
        type: "json",
        nodes: [{
            name: "",
            value: "",
            type: "string",
            note: "",
            must: true,
            lv: 1
        },
        {
            name: "",
            value: "",
            type: "string",
            note: "",
            must: true,
            lv: 2
        },
        {
            name: "",
            value: "",
            type: "string",
            note: "",
            must: true,
            lv: 1
        }]
    }
})
let n:any;
export const KeyContext = React.createContext(n)

